#include "utilityPredefine.h"
#include "RectEntity.h"
#include "gl/glut.h"

RectEntity::RectEntity(void)
{
}

RectEntity::~RectEntity(void)
{
}

void RectEntity::draw()
{
	glPushMatrix();
	
	Matrix4 mat = Matrix4::IDENTITY;//*matScale*matRot;
	mat.makeTransform(pos,scale,rot);
	mat = mat.transpose();
	//glLoadMatrixf(mat[0]);
	glMultMatrixf(mat[0]);
	glBegin(GL_QUADS);
	glNormal3f(0,0,1);
	glTexCoord2f(1,0); glVertex3f(w,0,0);
	glTexCoord2f(1,1); glVertex3f(w,h,0);
	glTexCoord2f(0,1); glVertex3f(0,h,0);
	glTexCoord2f(0,0); glVertex3f(0,0,0);
	glEnd();

	glPopMatrix();
}